<%
  const tradingPairOptions = Object.assign({
    className: ob.tradingPairClass,
    fromCur: ob.fromCur,
    toCur: ob.toCur,
  }, ob);
%>
<%= ob.crypto.tradingPair(tradingPairOptions) %>
<%
  let exchangeRateLine;

  if (!ob.fromRateUnavailable && !ob.toRateUnavailable) {
    const formattedFromCurAmount = new Intl.NumberFormat(ob.localCurrency, {
      minimumFractionDigits: 0,
      maximumFractionDigits: 8,
    }).format(ob.fromCurConvertedAmount);

    exchangeRateLine = ob.polyT('cryptoConversionPairing', {
      fromPairing: ob.currencyMod.formatCurrency(ob.fromCurAmount, ob.fromCur, { useCryptoSymbol: false }),
      toPairing: ob.currencyMod.formatCurrency(ob.toCurAmount, ob.toCur, { useCryptoSymbol: false }),
      fromCurAmount: formattedFromCurAmount,
    });
  } else {
    let icon = `<span class="${ob.iconClass}"></span>`;

    if (ob.noExchangeRateTip) {
      icon = `<span class="toolTip" data-tip="${ob.noExchangeRateTip}">${icon}</span>`;
    }

    exchangeRateLine = ob.polyT('cryptoTradingPair.cryptoConversionPairingNoToCurExchangeRate', {
      fromPairing: ob.currencyMod.formatCurrency(ob.fromCurAmount, ob.fromCur, { useCryptoSymbol: false }),
      icon,
    });
  }
%>
<div class="<%= ob.exchangeRateClass %>"><%= exchangeRateLine %></div>